package com.xiaoshuidi.cloud.module.contract.convert.contract;

import com.xiaoshuidi.cloud.framework.fadada.core.service.dto.CompanyInfoCompareParams;
import com.xiaoshuidi.cloud.framework.fadada.core.service.dto.SyncCompanyAutoParams;
import com.xiaoshuidi.cloud.module.contract.controller.admin.contract.vo.signingSubject.SigningSubjectCreateReqVO;
import com.xiaoshuidi.cloud.module.contract.controller.admin.contract.vo.signingSubject.SigningSubjectRespVO;
import com.xiaoshuidi.cloud.module.contract.controller.admin.contract.vo.signingSubject.SigningSubjectSwitchReqVO;
import com.xiaoshuidi.cloud.module.contract.controller.admin.contract.vo.signingSubject.SigningSubjectUpdateReqVO;
import com.xiaoshuidi.cloud.module.contract.dal.dataobject.contract.SigningSubjectDO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * 合同签约主体 Convert
 *
 * @author 合房租赁
 */
@Mapper
public interface SigningSubjectConvert {

    SigningSubjectConvert INSTANCE = Mappers.getMapper(SigningSubjectConvert.class);

    SigningSubjectDO convert(SigningSubjectCreateReqVO bean);

    @Mappings({
            @Mapping(source = "companyName", target = "company_name"),
            @Mapping(source = "legal", target = "legal_name"),
            @Mapping(source = "companyIdCard", target = "credit_no")
    })
    CompanyInfoCompareParams convertCreateReqVO2FadadaCompareParams(SigningSubjectCreateReqVO bean);

    @Mappings({
            @Mapping(source = "companyName", target = "customer_name"),
            @Mapping(source = "companyIdCard", target = "company_id")
    })
    SyncCompanyAutoParams convertCreateReqVO2FadadaSyncCompanyParams(SigningSubjectCreateReqVO bean);

    SigningSubjectDO convert(SigningSubjectUpdateReqVO bean);

    SigningSubjectRespVO convert(SigningSubjectDO bean);

    List<SigningSubjectRespVO> convertList(List<SigningSubjectDO> list);

    SigningSubjectUpdateReqVO convertSwitchVO2UpdateReqVO(SigningSubjectSwitchReqVO switchReqVO);

}
